﻿@model Model.DictionaryInfo
@{
    ViewBag.Title = "模型分类编辑";
    Layout = "~/Views/Shared/_Main.cshtml";
}
<style type="text/css">
    textarea
    {
        width: 400px;
        border: 1px solid #ccc;
        padding: 2px;
    }
    .pwdw
    {
        width: 148px;
    }
    .hide{ display:none;}
</style>
<script type="text/javascript">
    function SubmitForm() {
        $('#ff').form('submit', {
            url: '/PEPara/SaveMTData?dbName=' + encodeURI($.getUrlParam("dbName")),
            success: function (result) {
                switch (result) {
                    case "1":
                        alert("保存成功！");
                        BackToList();
                        break;
                    case "2":
                        alert("配置值在该组配置中已存在!");
                        return false;
                        break;
                    case "3":
                        alert("配置名称在该组配置中已存在!");
                        return false;
                        break;
                    default:
                        alert("保存失败");
                        return false;
                        break;
                } 
            }
        });
    }
    function BackToList() {
        window.location.href = "/PEPara/DictModelType?dbName=" + encodeURI($.getUrlParam("dbName"));
    }
  
</script>
<div style="margin: 5px;">
    <div id="p" class="easyui-panel" style="width: 800px; padding: 10px 5px 10px 5px;"
        data-options="title:'模型分类编辑',iconCls:'icon-edit'">
        <form id="ff" method="post">
        <table class="table_bg" style="background:#ffffff; width:780px" >
            <tr>
                <td style="width: 100px; text-align: right; height: 30px;">
                    名称：
                </td>
                <td>
                    <input type="text" id="txtName" name="Name" value="@Model.Name" style="width: 220px" class="easyui-validatebox"
                        data-options="required:true" />
                    <input type="hidden" name="Guid" id="hddGUID" value="@Model.Guid" />
                    <input type="hidden" name="ParentID" id="hddParentID"  value="@Model.ParentID"/>
                </td>
            </tr>
            <tr class="hide">
                <td style="width: 50px; text-align: right; height: 30px;">
                    值：
                </td>
                <td>
                    <input type="text" id="txtValue" name="Value" value="@Model.Value" @(Model.Guid==null?"":"disabled='disabled'")  style="width: 220px" class="easyui-validatebox"/>
                </td>
            </tr>
            <tr>
                <td style="width: 50px; text-align: right; height: 30px;">
                    描述：
                </td>
                <td> 
                     <textarea id="txtDescription" name="Description" style="width: 420px; height:100px">@Model.Description</textarea>
                </td>
            </tr>
            <tr>
                <td style="width: 50px; text-align: right; height: 30px;">
                    排序号：
                </td>
                <td>
                    <input type="text" id="txtOrderNo" name="OrderNo" value="@Model.OrderNo" class="easyui-numberspinner" data-options="required:true" />
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <input id="Save" type="button" value=" 保存 " onclick="return SubmitForm()" />
                    <input type="button" value=" 返回 " onclick="BackToList();" />
                </td>
            </tr>
        </table>
        </form>
    </div>
</div>
